<template>
  <transition name="el-zoom-in-center">
    <div class="JNPF-preview-main">
      <div class="JNPF-common-page-header">
        <el-page-header @back="goBack" content="详情" />
        <div class="options">
          <el-button @click="goBack">取 消</el-button>
        </div>
      </div>
      <el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
        <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right">
          <template v-if="!loading">
            <el-col :span="24">
              <el-form-item label="企业名称" prop="companynam">
                <p>{{dataForm.companynam}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="企业简称" prop="simplenam">
                <p>{{dataForm.simplenam}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="企业类型" prop="type">
                <p>{{ dataForm.type | dynamicText(typeOptions) }} </p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="企业介绍" prop="introduce">
                <p>{{dataForm.introduce}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="企业地址" prop="adress">
                <p>{{dataForm.adress}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="企业联系人" prop="contact">
                <p>{{dataForm.contact}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="联系人电话" prop="phone">
                <p>{{dataForm.phone}}</p>
              </el-form-item>
            </el-col>
          </template>
        </el-form>
      </el-row>
    </div>
  </transition>
</template>
<script>
  import request from '@/utils/request'
  import PrintBrowse from '@/components/PrintBrowse'
  import jnpf from '@/utils/jnpf'
  export default {
    components: {
      PrintBrowse
    },
    props: [],
    data() {
      return {
        visible: false,
        loading: false,
        printBrowseVisible: false,
        printId: '',
        dataForm: {
          id: '',
          companynam: '',
          simplenam: '',
          type: "",
          introduce: '',
          adress: '',
          contact: '',
          phone: '',
        },
        typeOptions: [{
          "fullName": "私企",
          "id": "1"
        }, {
          "fullName": "国企",
          "id": "2"
        }],

      }
    },
    computed: {},
    watch: {},
    created() {

    },
    mounted() {},
    methods: {
      dataInfo(dataAll) {
        let _dataAll = dataAll
        this.dataForm = _dataAll
      },

      goBack() {
        this.$emit('refresh')
      },
      init(id) {
        this.dataForm.id = id || 0;
        this.visible = true;
        this.$nextTick(() => {
          if (this.dataForm.id) {
            this.loading = true
            request({
              url: '/api/example/BusCompany/detail/' + this.dataForm.id,
              method: 'get'
            }).then(res => {
              this.dataInfo(res.data)
              this.loading = false
            })
          }

        })
      },
    },
  }

</script>
